package kr.re.etri.snsenabler.server.api;

import org.scribe.builder.api.DefaultApi10a;
import org.scribe.model.Token;

public class DaumApi extends DefaultApi10a {
	private static final String AUTHORIZE_URL = "https://apis.daum.net/oauth/authorize?oauth_token=%s";
	private static final String REQUEST_TOKEN_RESOURCE = "https://apis.daum.net/oauth/requestToken";
	private static final String ACCESS_TOKEN_RESOURCE = "https://apis.daum.net/oauth/accessToken";

	@Override
	public String getAccessTokenEndpoint() {
		return ACCESS_TOKEN_RESOURCE;
	}

	@Override
	public String getRequestTokenEndpoint() {
		return REQUEST_TOKEN_RESOURCE;
	}

	@Override
	public String getAuthorizationUrl(Token requestToken) {
		return String.format(AUTHORIZE_URL, requestToken.getToken());
	}
}
